<?php
	$tableName = 'ContactPerson';
	$parentId = isset($id)?$id:NULL;
	if(isset($contactPeople)) {
		if(isset($id)){
			$parentId = $id;
		}
		$controller = 'contact_people';
?>
<h1>
	<?php __('Contact Person')?>
	<?php echo $this->Html->link($this->Html->image('assets/icons/dashboard/95.png', array('alt' => 'add')),
										'/admin/'.$this->params['controller']. '/' .'add/'. $parentId,  
										array('escape' => false, 'class'=>'tooltip table_icon', 'title' => __('Add Contact Person',true), 'rel' => 'add'));
	?>
	<?php echo $this->Html->link($this->Html->image('assets/icons/dashboard/28.png', array('alt' => 'add')),
										'/admin/job_providers',  
										array('escape' => false, 'class'=>'tooltip table_icon', 'title' => __('Back to Company',true)));
	?>
</h1>
<p><?php __('Add, Edit and Delete Contact people.');?></p>
<table class="normal">
	<thead>
		<tr>
			<th><?php __('Name');?></th>
			<th><?php __('furigana');?></th>
			<th><?php __('mobile');?></th>
			<th><?php __('email');?></th>
			<th><?php __('position');?></th>
			<th class="actions"><?php __('Actions');?></th>
		</tr>
	</thead>
	<tbody>
		<tr id="row0">	
			<?php echo $this->Form->input('ContactPerson.job_provider_id', array('type' => 'hidden'));?>
			<td><?php echo $this->Form->input('ContactPerson.name', array('label' => false));?></td>
			<td><?php echo $this->Form->input('ContactPerson.furigana', array('label' => false));?></td>
			<td><?php echo $this->Form->input('ContactPerson.mobile', array('label' => false));?></td>
			<td><?php echo $this->Form->input('ContactPerson.email', array('label' => false));?></td>
			<td><?php echo $this->Form->input('ContactPerson.position', array('label' => false));?></td>
			<td class = "actions">
				<?php 
				echo $this->Html->link($this->Html->image('assets/icons/small_icons/Save.png', array('alt' => 'save')),
														'/admin/'.$this->params['controller']. '/' .'save' , 
														array('rel' => 'save', 'escape' => false));
				echo $this->Html->link($this->Html->image('assets/icons/small_icons/Close.png', array('alt' => 'cancel')), '',
														array('rel' => 'cancel', 'escape' => false));
				?>										
			</td>
		</tr> 
	<?php
		$i = 0;
		foreach ($contactPeople as $location):
			$class = null;
			if ($i++ % 2 != 0) {
				$class = ' class="odd"';
			}
	?>
	<tr<?php echo $class;?> id="row<?php echo $location['ContactPerson']['id']; ?>">	
		<td><?php echo $location['ContactPerson']['name'];?></td>
		<td><?php echo $location['ContactPerson']['furigana'];?></td>
		<td><?php echo $location['ContactPerson']['mobile'];?></td>
		<td><?php echo $location['ContactPerson']['email'];?></td>
		<td><?php echo $location['ContactPerson']['position'];?></td>
		<td class="actions">
			<?php echo $this->Html->link($this->Html->image('assets/icons/actions_small/Pencil.png', array('alt' => 'Edit')),
											'/admin/'.$this->params['controller']. '/' .'add'.'/'.$location['ContactPerson']['id'].'/'. 1,  
											array('rel' => 'edit', 'escape' => false, 'class'=>'tooltip table_icon'));
			?>
			<?php echo $this->Html->link($this->Html->image('assets/icons/actions_small/Trash.png', array('alt' => 'Delete')),
											'/admin/'.$this->params['controller']. '/' .'delete'.'/'.$location['ContactPerson']['id'],  
											array('rel' => 'delete', 'escape' => false, 'class'=>'tooltip table_icon'));
			?>
		</td>
	</tr>
	<?php endforeach;?>
	</tbody>
</table>
<?php }?>